<?php
/* OpenBIBLIO -- A library administration web interface
 * Copyright (C) 2002-2005 Fr&eacute;d&eacute;ric Descamps <lefred@tiscali.be>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

$id	= $_GET['id'];

if(!$id)
{
        $requete = "select t1.id, t1.nom, t1.prenom, t2.classe from eleves as t1 inner join classes as t2 on t2.id = t1.classe_id where del=0 order by nom";
        if(!($resultat = biblio_db_query($requete)))
        { print "PROBLEME : " .biblio_db_error(); }
        else 
        {
                echo "<CENTER><H3>";
		echo _("Effacer un &eacute;l&egrave;ve");
		echo "</H3>";
                echo "<TABLE><TR><th>Nom</th><th>";
		echo _("Pr&eacute;nom");
		echo "</th><th>";
		echo _("Classe");
		echo "</th><th>";
		echo _("Action");
		echo "</B></TD>";
        
                while ($row = biblio_db_fetch_array($resultat)) 
	        {      
                        $eleve_id = $row['id'];           
                        $eleve_nom =  $row['nom'];                                
                        $eleve_prenom =  $row['prenom'];                                
                        $eleve_classe =  $row['classe'];   
                        echo "<TR><TD>$eleve_nom</TD><TD>$eleve_prenom</TD><TD>$eleve_classe</TD><TD><A href=\"admin.php?action=del&type=eleve&id=$eleve_id\">effacer</A></TD>";            
                }
                echo "</TABLE></CENTER>";
        }
}
else
{            
      $requete = "update eleves set del = 1 where id=$id";
      if(!($resultat = biblio_db_query($requete)))
      { echo "PROBLEME : " .biblio_db_error(); exit;}  
      put_log(4,$requete,$user);
      echo "<CENTER><BR>";
      echo _("Cet utilisateur a &eacute;t&eacute; &eacute;ffac&eacute;.");
      echo "<br></center>";
}
?>

<br><br>
<div>
<span id=left-text>
<A HREF="admin.php?menu=1">
<?php echo _("retour menu administration"); ?>
</A><BR>
<A HREF="index.php">
<?php echo _("retour menu principal"); ?>
</A></span>
</div>
<br>

